Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
i Get a "Property type does not exist on type boolean" error when i try to do an inline ternary operator in vue3 typescript

The error Property type does not exist on type boolean shows on the show.value boolean

when I try to apply the text for the icon based on the truthiness

<template>

<div class="d-flex cursor-pointer justify-content-between border rounded bg-white mt-4 p-2 w-100 " @click="dropdown">
    <span>Purchase Requsition</span>
    <span class="material-icons fs-28 text-primary">
{{show.value ? 'arrow_circle_down' : 'arrow_circle_down' }}     </span>
</div>

</template>

<script setup lang="ts">
import { ref } from "vue";

const show = ref<boolean>(false)

function dropdown(){
   show.value = !show.value
}
</script>

<style scoped>

</style>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You should use show instead of show.value in your template. show.value is only available within the script tag in the composition api.

<template>

<div class="d-flex cursor-pointer justify-content-between border rounded bg-white mt-4 p-2 w-100 " @click="dropdown">
    <span>Purchase Requsition</span>
    <span class="material-icons fs-28 text-primary">
      {{show ? 'arrow_circle_down' : 'arrow_circle_down' }}
    </span>
</div>

</template>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda